﻿using System.Windows.Forms;
using DrawTools.Editor.CanvasFigures;
using DrawTools.Tools;

namespace DrawTools.Editor.Tools
{
  public class TextTool : RectangleTool
  {
    public TextTool(EditorColorSettrings settings) : base(settings) {}

    public override void OnMouseDown(IDrawingCanvas canvas, MouseEventArgs e)
    {
      var text = new CanvasText("Empty Text", e.X, e.Y, 1, 1)
      {
        BorderColor = Settings.BorderColor,
        BackColor = Settings.BackColor,
        BackgroundOpacity = 128,
        TextColor = Settings.TextColor,
        FontSize = 18,
        Text = "Double click to edit text"
      };

      AddNewObject(canvas, text);
    }
  }
}